<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>综合2</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .box {
            display: flex;
            justify-content: space-evenly;
            flex-wrap: wrap;
            margin: 0 auto;
            width: 550px;
        }

        .pic {
            width: 100px;
            height: 100px;
            margin-bottom: 5px;
            border: 3px solid skyblue;
            border-radius: 10px 0 10px 0;
            /* background-image: url(./images/1.webp); */
        }
    </style>
</head>

<body>
    <div class="box">
        <!-- <div class="pic" style="background-image: url(./images/1.webp);"></div>
        <div class="pic"></div>
        <div class="pic"></div>
        <div class="pic"></div>
        <div class="pic"></div>
        <div class="pic"></div>
        <div class="pic"></div>
        <div class="pic"></div>
        <div class="pic"></div>
        <div class="pic"></div> -->
        <script>
            let num = prompt('请输入1~20之前的英雄个数')
            for (let i = 1; i <= num; i++) {
                document.write(`
                <div class="pic" style="background-image: url(./images/${i}.webp);"></div>
                `)
            }
        </script>
    </div>
</body>

</html>